/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ManualHeraclito.java
 *
 * Created on 01/10/2012, 15:40:38
 */
package heraclito;

import Dados.Exemplos;
import Dados.Parametros;

/**
 *
 * @author Marcel
 */
public class ManualHeraclito extends javax.swing.JPanel {
    
    private Exemplos Ex;
    private String diretorioManual;
    private int indexAba;

    /** Creates new form ManualHeraclito */
    public ManualHeraclito() {
        initComponents();
        //Carrega a variaveis que carrega os exemplos
        this.diretorioManual="Manual";
        Ex = new Exemplos(".");
       String aux[]=Ex.getExemplos(diretorioManual).split("\n");
        menu.setListData(aux);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        menu = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        exibe = new javax.swing.JEditorPane();

        setName("Form"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        menu.setName("menu"); // NOI18N
        menu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                menuMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(menu);

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        exibe.setName("exibe"); // NOI18N
        jScrollPane2.setViewportView(exibe);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1151, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void menuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuMouseClicked
        // TODO add your handling code here:
        String aux=menu.getSelectedValue().toString();
        exibe.setText(Ex.getExemplo(diretorioManual, aux));
    }//GEN-LAST:event_menuMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane exibe;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JList menu;
    // End of variables declaration//GEN-END:variables
}
